package fr.curriculumvitae.anthony.stephan.utils;

import fr.curriculumvitae.anthony.stephan.backend.BackEnd;
import fr.curriculumvitae.anthony.stephan.backend.IGetStateCallback;
import fr.curriculumvitae.anthony.stephan.objects.State;

public class StateManager {
	
	public static State myState = null;
	
	public static void fetchState() {
		Log.d("StateManager", "fetchState");
		BackEnd.getState(getStateCallback);
	}
	
	
	  ///////////////
	 // CALLBACKS //
	///////////////
	
	private static IGetStateCallback getStateCallback = new IGetStateCallback() {
		@Override
		public void getStateEnded(boolean success, State state, String message) {
			Log.d("StateManager", "getStateCallback.getStateEnded.state = "+state);
			if(success && state != null) {
				myState = state;
			}
		}
	};

}
